import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrHireApplyVO, HrHireApplyForm, HrHireApplyQuery } from '@/api/general/humanresources/onboard/hire/types';

/**
 * 查询新员工录用审批列表
 * @param query
 * @returns {*}
 */

export const listHrHireApply = (query?: HrHireApplyQuery): AxiosPromise<HrHireApplyVO[]> => {
  return request({
    url: '/humanresource/hrHireApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询新员工录用审批详细
 * @param id
 */
export const getHrHireApply = (id: string | number): AxiosPromise<HrHireApplyVO> => {
  return request({
    url: '/humanresource/hrHireApply/' + id,
    method: 'get'
  });
};

/**
 * 新增新员工录用审批
 * @param data
 */
export const addHrHireApply = (data: HrHireApplyForm) => {
  return request({
    url: '/humanresource/hrHireApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改新员工录用审批
 * @param data
 */
export const updateHrHireApply = (data: HrHireApplyForm) => {
  return request({
    url: '/humanresource/hrHireApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除新员工录用审批
 * @param id
 */
export const delHrHireApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrHireApply/' + id,
    method: 'delete'
  });
};
